<?php
ob_start();
include 'conn.php';


$name = $_POST["user"];
$pw = $_POST["pw"];

$query = mysql_query("SELECT user, password FROM login WHERE user LIKE '$name' LIMIT 1"); 
$row = mysql_fetch_object($query); 
if($row->user <> $name)
{
    echo 'Your username is wrong!';
}else{
if($row->password <> $pw) 
    { 
    echo 'Your password is wrong!';
}else{
session_register("name");
session_register("pw"); 
header("location:login_check.php"); 
}
}
ob_end_flush();
?>